public class TestDuck {
    public static void main(String[] args) {
        // 测试家鸭
        DomesticDuck domesticDuck = new DomesticDuck("白色", 2.5);
        System.out.println("家鸭-颜色：" + domesticDuck.getColor() + "，重量：" + domesticDuck.getHeavy() + "kg");
        domesticDuck.fly();
        domesticDuck.quack();
        domesticDuck.setHeavy(3); // 调用int类型重载方法
        System.out.println("家鸭修改后重量：" + domesticDuck.getHeavy() + "kg\n");

        // 测试野鸭
        WildDuck wildDuck = new WildDuck("褐色", 1.8);
        System.out.println("野鸭-颜色：" + wildDuck.getColor() + "，重量：" + wildDuck.getHeavy() + "kg");
        wildDuck.fly();
        wildDuck.quack();
        wildDuck.setHeavy("2.2"); // 调用String类型重载方法
        System.out.println("野鸭修改后重量：" + wildDuck.getHeavy() + "kg");
    }
}